-
Notifications
You must be signed in to change notification settings - Fork 81
Initial commit for task end points #691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Fresh avocado detected! Welcome and thank you for your contribution @bluepal-prasanthi-moparthi. My avocado-loving overlords have decreed a signed CLA is required for PRs. Please see https://github.com/arangodb/arangodb/blob/devel/CONTRIBUTING.md file to learn more or ask cla(at)arangodb.com if you have issues. |
please rerun test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements task management endpoints for ArangoDB v2, adding the ability to create, list, retrieve, and delete tasks through the Go driver. It introduces comprehensive task API functionality with proper validation, error handling, and test coverage.
- Complete task management API implementation including CRUD operations
- Comprehensive test coverage with positive and negative test cases
- Integration with the existing client structure through interface composition
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
v2/arangodb/tasks.go | Defines ClientTasks interface, TaskOptions struct, and Task interface for task management |
v2/arangodb/tasks_impl.go | Implements task management functionality with HTTP API calls and response handling |
v2/arangodb/client.go | Adds ClientTasks interface to the main Client interface |
v2/arangodb/client_impl.go | Integrates clientTask into the client struct and initialization |
v2/tests/tasks_test.go | Comprehensive test suite covering task creation, validation, and operations |
Comments suppressed due to low confidence (7)
v2/tests/tasks_test.go:41
- The task name 'taskWIthParams' contains inconsistent capitalization. Should be 'taskWithParams'.
"taskWIthParams": {
v2/tests/tasks_test.go:42
- The task name 'taskWIthParams' contains inconsistent capitalization. Should be 'taskWithParams'.
Name: utils.NewType("taskWIthParams"),
v2/tests/tasks_test.go:49
- The task name 'taskWIthOutParams' contains inconsistent capitalization. Should be 'taskWithoutParams'.
"taskWIthOutParams": {
v2/tests/tasks_test.go:50
- The task name 'taskWIthOutParams' contains inconsistent capitalization. Should be 'taskWithoutParams'.
Name: utils.NewType("taskWIthOutParams"),
v2/tests/tasks_test.go:111
- The task name 'taskWIthOutCommand' contains inconsistent capitalization. Should be 'taskWithoutCommand'.
"taskWIthOutCommand": {
v2/tests/tasks_test.go:112
- The task name 'taskWIthOutCommand' contains inconsistent capitalization. Should be 'taskWithoutCommand'.
Name: utils.NewType("taskWIthOutCommand"),
v2/tests/tasks_test.go:115
- The task name 'taskWIthOutPeriod' contains inconsistent capitalization. Should be 'taskWithoutPeriod'.
"taskWIthOutPeriod": nil,
} | ||
|
||
// Tasks retrieves all tasks from the specified database. | ||
// Retuns a slice of Task objects representing the tasks in the database. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spelling error: 'Retuns' should be 'Returns'.
// Retuns a slice of Task objects representing the tasks in the database. | |
// Returns a slice of Task objects representing the tasks in the database. |
Copilot uses AI. Check for mistakes.
Name string `json:"name,omitempty"` | ||
Command string `json:"command,omitempty"` | ||
Params json.RawMessage `json:"params,omitempty"` | ||
Period int64 `json:"period,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use pointers
id string | ||
name string | ||
command string | ||
params json.RawMessage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use pointers
This PR includes the implementation and test cases for the following task-related endpoints:
List all tasks
Get a specific task
Create a new task
Create a task with a specific ID
Remove a task